template <class Type> Type Sum(Type a[], int n) {
    Type sum{0};
    for (int i = 0; i < n; ++i)
        sum += *a++;
    return sum;
}
